//
//  SubmitImageAction.m
//  ICrEAM
//
//  Created by mac on 16/11/24.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "SubmitImageAction.h"

@implementation SubmitImageAction
- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPost;
}
- (AFConstructingBlock)constructingBodyBlock {
    return ^(id<AFMultipartFormData> formData) {
        
        for (int i = 0 ; i<_images.count ; i++) {
            NSData *data = UIImageJPEGRepresentation(_images[i], 0.5);
            NSString *name = [NSString stringWithFormat:@"outer%d.jpeg",i];
            NSString *formKey = @"FILE_INNER";
            NSString *type = @"jpeg";
            [formData appendPartWithFileData:data name:formKey fileName:name mimeType:type];
        }
    };
}
// 请求URL
- (NSString *)requestUrl {
    return FinishSubmitImageUrl;
}
@end
